//
//  JTOrderTool.m
//  囧途
//
//  Created by 杨璟 on 16/3/12.
//  Copyright © 2016年 fly. All rights reserved.
//

#import <AVOSCloud.h>

#import "JTOrderTool.h"
#import "JTConst.h"

#import <AVOSCloud.h>

@implementation JTOrderTool

+ (void)searchDriverTrip:(NSDictionary *)params success:(void (^)(id responseObject))success failure:(void (^)(NSError *))failure {
    NSError *error = [NSError errorWithDomain:@"zh_CN" code:0 userInfo:nil];
    id object = [AVCloud callFunction:@"DriverOrder" withParameters:params error:&error];
    if (error) {
        if (failure) {
            failure(error);
            NSLog(@"error:1111%@", error.localizedDescription);
        }
    } else {
        if (success) {
            success(object);
        }
    }
}

+ (void)searchPassengerTrip:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure {
    NSError *error = [NSError errorWithDomain:@"zh_CN" code:0 userInfo:nil];
    id object = [AVCloud callFunction:@"ownerOrder" withParameters:params error:&error];
    if (error) {
        if (failure) {
            failure(error);
            NSLog(@"error:%@", error.localizedDescription);
        }
    } else {
        if (success) {
            success(object);
        }
    }
}

@end
